@extends('layouts.app')

@section('content')
<div class="container">
    <div class="row">
        <div class="col-md-8 col-md-offset-2">
            <div class="panel panel-default">
                <div class="panel-heading">添加二维码</div>
                <div class="panel-body">
                    @if(!empty($qrcode_url))
                        <img style="width: 100%;" src="{{ $qrcode_url }}">
                        <p>已为您生成湖南航信公众号个人识别二维码，请长摁后“发送给朋友”或“保存图片”。</p>
                        <p>或者发送"城市_姓名"到公众号查询下载</p>
                    @else
                    <form class="form-horizontal" role="form" method="POST" action="{{ url('wechatserver/registerscene') }}">
                        {{ csrf_field() }}

                        <div class="form-group{{ $errors->has('city') ? ' has-error' : '' }}">
                            <label for="name" class="col-md-4 control-label">城市</label>
                            <div class="col-md-6">
                                <select id="city" name="city" class="form-control">
                                    <option value="长沙">长沙</option>
                                    <option value="株洲">株洲</option>
                                    <option value="湘潭">湘潭</option>
                                    <option value="衡阳">衡阳</option>
                                    <option value="邵阳">邵阳</option>
                                    <option value="岳阳">岳阳</option>
                                    <option value="常德">常德</option>
                                    <option value="张家界">张家界</option>
                                    <option value="益阳">益阳</option>
                                    <option value="郴州">郴州</option>
                                    <option value="永州">永州</option>
                                    <option value="怀化">怀化</option>
                                    <option value="娄底">娄底</option>
                                    <option value="湘西">湘西</option>
                                    <option value="客服">客服</option>
                                    <option value="远程">远程</option>
                                    <option value="金税">金税</option>
                                </select>
                                @if ($errors->has('city'))
                                    <span class="help-block">
                                        <strong>{{ $errors->first('city') }}</strong>
                                    </span>
                                @endif
                            </div>
                        </div>

                        <div class="form-group{{ $errors->has('name') ? ' has-error' : '' }}">
                            <label for="email" class="col-md-4 control-label">姓名</label>

                            <div class="col-md-6">
                                <input id="name" type="text" class="form-control" name="name" value="{{ old('name') }}" required>

                                @if ($errors->has('name'))
                                    <span class="help-block">
                                        <strong>{{ $errors->first('name') }}</strong>
                                    </span>
                                @endif
                            </div>
                        </div>

                        <div class="form-group{{ $errors->has('keyword') ? ' has-error' : '' }}">
                            <label for="keyword" class="col-md-4 control-label">自动回复</label>

                            <div class="col-md-6">
                                <input id="keyword" type="text" class="form-control" name="keyword" required>

                                @if ($errors->has('keyword'))
                                    <span class="help-block">
                                        <strong>{{ $errors->first('keyword') }}</strong>
                                    </span>
                                @endif
                            </div>
                        </div>

                        <div class="form-group">
                            <div class="col-md-6 col-md-offset-4">
                                <button type="submit" class="btn btn-primary">
                                    保存
                                </button>
                            </div>
                        </div>
                    </form>
                    @endif
                </div>
            </div>
        </div>
    </div>
</div>
@endsection
